package com.example;

/**
 * @desc:
 * @author: Shoko
 * @date: 2025/5/25
 */
// 百分比折扣策略
public class PercentageStrategy implements DiscountStrategy {
    private double percentage;

    public PercentageStrategy(double percentage) {
        this.percentage = percentage;
    }

    @Override
    public double calculate(double price) {
        return price * (1 - percentage / 100);
    }
}
